﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.SM
{
    class Class16
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("重疾"))
            {
                double m = ppa.GetDutyTotalValue("重大疾病保险");

                if (m <= double.Epsilon)
                {
                    da.Value = ppa.Amount;
                }
                
            }

            if (ppa.Period > 0 && ppa.PolicyActing.PeriodActings[ppa.Period - 1].SchemePeriodActing.InsurantStates.Contains("重疾"))
            {
                ppa.Fee = 0;
            }

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                double m = ppa.GetDutyTotalValue("重大疾病保险");

                da.Value = ppa.Amount - m;

            }



        }
    }
}
